﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        var loc="";
        $(function () {
	    alert(navigator.userAgent.toLowerCase());
            if (navigator.userAgent.toLowerCase().indexOf("msie")>-1) {
		alert("msie");
		$('#response').hide();
	    }
            loc = document.location.origin;
            console.log(loc);

        });
        function check()
        {

	    	if (navigator.userAgent.toLowerCase().indexOf("msie")==-1) {		
			$.ajax({
        	        	type: "GET",
	                	url: "phch.aspx?ID=79001234567&WAIT=30",
		                dataType: "html",
        		        async: true,
                		contentType: "text/xml; charset=utf-8",
		                success: function (response, status) {
				    document.getElementById("rtext").innerHTML = "Response was: "+response.responseText;
                		    alert("success:"+response.responseText);
		                },
        		        error: function (response, status, estatus) {
		                    alert("error: " + status);
        		        },
                		complete: function (response) {
	                	    console.log("complete: " + response.responseText);
	        	            document.getElementById("rtext").innerHTML = "Response was: "+response.responseText;
				    alert(response.responseText);
	        	        }
	        	});
		
        	}
		else       
		{
			var ajax=new XMLHttpRequest();
			ajax.open("GET","phch.aspx?ID=79001234567&WAIT=30",true);
			ajax.send();
			ajax.onreadystatechange=function(){
				if(ajax.readyState==4 && (ajax.status==200)){
			        alert(ajax.responseText)}

			}
		}

	}

    </script>

</head>
<body>
2012-05-15
    <p>
        <input id="btn" type="button" value="Проверить" onclick="javascvript:check()" /></p>
        <div id="response"><pre id="rtext">&nbsp</pre></div>

</body>
</html>
